#ifndef _MYLOG_H_
#define _MYLOG_H_

#define LV_FATAL	0
#define LV_ERROR	1
#define LV_LOG		2
#define LV_DEBUG	3
#define LV_DETAIL	4

//#define MY_LOG_LEVEL		LV_ERROR
//#define MY_LOG_LEVEL		LV_LOG
#define MY_LOG_LEVEL		LV_DEBUG

#include <stdio.h>
extern FILE * lfp;

#ifndef NDEBUG
#define LOGON(path)					mylogon(path)
#define LOGOFF()					mylogoff()
#define LOGIT(level, fmt, ...)		mylogit(level, fmt, ## __VA_ARGS__)
#else
#define LOGON(path)	
#define LOGOFF()
#define LOGIT(level, fmt, ...)
#endif

int mylogon(const char * path);
int mylogoff();
int mylogit(unsigned char level, const char *fmt, ...);

#endif
